<?php
/*class Solution {
    public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        ListNode head = new ListNode(-1);
        //保留List头
        ListNode result = head;
        //进位
        int carry = 0;
        int sum = 0;

        while (l1!= null || l2 != null) {
            sum = 0;
            if (l1 != null) {
                sum = sum + l1.val;
                l1 = l1.next;
            }

            if (l2 != null) {
                sum = sum + l2.val;
                l2 = l2.next;
            }

            sum = sum + carry;
            carry = 0;

            if (sum >= 10) {
                carry = 1;
                sum = sum - 10;
            }

            head.next = new ListNode(sum);
            head = head.next;
        }

        if (carry == 1) {
            head.next = new ListNode(1);
        }

        return result.next;
    }
}*/